<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <title>02-before-after</title>
    <style>
        div::before {
            content: "666";
            color: blue;
        }
        div::after {
            content: url("images/5.gif");
            width: 20px;
            height: 20px;
        }
        div {
            color: red;
        }
    </style>
</head>

<body>
    <div>我是div</div>
</body>

</html>